from time import time
h = open("m1_sorted.txt")
w = [int(i) for i in h]
n = len(w)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if w[j]>w[j+1]:
            w[j],w[j+1]=w[j+1],w[j]
print(w)
end = time()
total = (end - start)*1000
print("Общее время:", round(total), "мс")

from time import time
h = open("m2_reverse.txt")
w = [int(i) for i in h]
n = len(w)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if w[j]>w[j+1]:
            w[j],w[j+1]=w[j+1],w[j]
print(w)
end = time()
total = (end - start)*1000
print("Общее время:", round(total), "мс")

from time import time
h = open("m3_shuffle.txt")
w = [int(i) for i in h]
n = len(w)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if w[j]>w[j+1]:
            w[j],w[j+1]=w[j+1],w[j]
print(w)
end = time()
total = (end - start)*1000
print("Общее время:", round(total), "мс")	
